﻿function AnswerAdd(Result) {
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=UTF-8",
        url: "Student/Preview_Ask.aspx/AnswerAdd",
        data: "{PreviewId:'" + p + "',UserId:'" + userId + "',Result:'" + decodeURIComponent(Result) + "'}",
        dataType: "json",
        success: function (obj) {
            var data = eval('(' + obj.d + ')');
            if (!data.IsSuccess) {
                alert(data.Msg);
                if (data.Msg.indexOf("您已经登录超时") != -1) window.location.href = "/Login.aspx";
            } else {
                var listHtml = "<div class='bufen'>";
                listHtml += "<table border='0' cellspacing='0' cellpadding='0' width='100%'>";
                listHtml += "<tr><td><div class='soall'>" + $("#textfield").val() + "</div></td></tr></table></div>";
                $(".zhengti").remove();
                $(".spin").after(listHtml);
            }
        },
        error: function (r, t, e) {
            alert(t);
        }
    });
}